3.1.100 \(\int (-a+b \cot (c+d x)) \sqrt {a+b \cot (c+d x)} \, dx\) [100]

3.1.100.1 Optimal result
3.1.100.2 Mathematica [A] (verified)
3.1.100.3 Rubi [A] (warning: unable to verify)
3.1.100.4 Maple [B] (verified)
3.1.100.5 Fricas [B] (verification not implemented)
3.1.100.6 Sympy [F]
3.1.100.7 Maxima [F]
3.1.100.8 Giac [F]
3.1.100.9 Mupad [B] (verification not implemented)

3.1.100.1 Optimal result

Integrand size = 27, antiderivative size = 422 \[ \int (-a+b \cot (c+d x)) \sqrt {a+b \cot (c+d x)} \, dx=\frac {b \sqrt {a^2+b^2} \text {arctanh}\left (\frac {\sqrt {a+\sqrt {a^2+b^2}}-\sqrt {2} \sqrt {a+b \cot (c+d x)}}{\sqrt {a-\sqrt {a^2+b^2}}}\right )}{\sqrt {2} \sqrt {a-\sqrt {a^2+b^2}} d}-\frac {b \sqrt {a^2+b^2} \text {arctanh}\left (\frac {\sqrt {a+\sqrt {a^2+b^2}}+\sqrt {2} \sqrt {a+b \cot (c+d x)}}{\sqrt {a-\sqrt {a^2+b^2}}}\right )}{\sqrt {2} \sqrt {a-\sqrt {a^2+b^2}} d}-\frac {2 b \sqrt {a+b \cot (c+d x)}}{d}-\frac {b \sqrt {a^2+b^2} \log \left (a+\sqrt {a^2+b^2}+b \cot (c+d x)-\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} \sqrt {a+b \cot (c+d x)}\right )}{2 \sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} d}+\frac {b \sqrt {a^2+b^2} \log \left (a+\sqrt {a^2+b^2}+b \cot (c+d x)+\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} \sqrt {a+b \cot (c+d x)}\right )}{2 \sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} d} \]

output
-2*b*(a+b*cot(d*x+c))^(1/2)/d+1/2*b*arctanh((-2^(1/2)*(a+b*cot(d*x+c))^(1/ 
2)+(a+(a^2+b^2)^(1/2))^(1/2))/(a-(a^2+b^2)^(1/2))^(1/2))*(a^2+b^2)^(1/2)/d 
*2^(1/2)/(a-(a^2+b^2)^(1/2))^(1/2)-1/2*b*arctanh((2^(1/2)*(a+b*cot(d*x+c)) 
^(1/2)+(a+(a^2+b^2)^(1/2))^(1/2))/(a-(a^2+b^2)^(1/2))^(1/2))*(a^2+b^2)^(1/ 
2)/d*2^(1/2)/(a-(a^2+b^2)^(1/2))^(1/2)-1/4*b*ln(a+b*cot(d*x+c)+(a^2+b^2)^( 
1/2)-2^(1/2)*(a+b*cot(d*x+c))^(1/2)*(a+(a^2+b^2)^(1/2))^(1/2))*(a^2+b^2)^( 
1/2)/d*2^(1/2)/(a+(a^2+b^2)^(1/2))^(1/2)+1/4*b*ln(a+b*cot(d*x+c)+(a^2+b^2) 
^(1/2)+2^(1/2)*(a+b*cot(d*x+c))^(1/2)*(a+(a^2+b^2)^(1/2))^(1/2))*(a^2+b^2) 
^(1/2)/d*2^(1/2)/(a+(a^2+b^2)^(1/2))^(1/2)
 
3.1.100.2 Mathematica [A] (verified)

Time = 0.75 (sec) , antiderivative size = 153, normalized size of antiderivative = 0.36 \[ \int (-a+b \cot (c+d x)) \sqrt {a+b \cot (c+d x)} \, dx=\frac {b \left (\frac {\left (a^2+b^2\right ) \text {arctanh}\left (\frac {\sqrt {a+b \cot (c+d x)}}{\sqrt {a-\sqrt {-b^2}}}\right )}{\sqrt {-b^2} \sqrt {a-\sqrt {-b^2}}}-\frac {\left (a^2+b^2\right ) \text {arctanh}\left (\frac {\sqrt {a+b \cot (c+d x)}}{\sqrt {a+\sqrt {-b^2}}}\right )}{\sqrt {-b^2} \sqrt {a+\sqrt {-b^2}}}-2 \sqrt {a+b \cot (c+d x)}\right )}{d} \]

input
Integrate[(-a + b*Cot[c + d*x])*Sqrt[a + b*Cot[c + d*x]],x]
 
output
(b*(((a^2 + b^2)*ArcTanh[Sqrt[a + b*Cot[c + d*x]]/Sqrt[a - Sqrt[-b^2]]])/( 
Sqrt[-b^2]*Sqrt[a - Sqrt[-b^2]]) - ((a^2 + b^2)*ArcTanh[Sqrt[a + b*Cot[c + 
 d*x]]/Sqrt[a + Sqrt[-b^2]]])/(Sqrt[-b^2]*Sqrt[a + Sqrt[-b^2]]) - 2*Sqrt[a 
 + b*Cot[c + d*x]]))/d
 
3.1.100.3 Rubi [A] (warning: unable to verify)

Time = 0.75 (sec) , antiderivative size = 453, normalized size of antiderivative = 1.07, number of steps used = 14, number of rules used = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.481, Rules used = {3042, 4011, 27, 3042, 3966, 484, 1407, 1142, 25, 27, 1083, 219, 1103}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int (b \cot (c+d x)-a) \sqrt {a+b \cot (c+d x)} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \left (-a-b \tan \left (c+d x+\frac {\pi }{2}\right )\right ) \sqrt {a-b \tan \left (c+d x+\frac {\pi }{2}\right )}dx\)

\(\Big \downarrow \) 4011

\(\displaystyle \int \frac {-a^2-b^2}{\sqrt {a+b \cot (c+d x)}}dx-\frac {2 b \sqrt {a+b \cot (c+d x)}}{d}\)

\(\Big \downarrow \) 27

\(\displaystyle -\left (a^2+b^2\right ) \int \frac {1}{\sqrt {a+b \cot (c+d x)}}dx-\frac {2 b \sqrt {a+b \cot (c+d x)}}{d}\)

\(\Big \downarrow \) 3042

\(\displaystyle -\left (a^2+b^2\right ) \int \frac {1}{\sqrt {a-b \tan \left (c+d x+\frac {\pi }{2}\right )}}dx-\frac {2 b \sqrt {a+b \cot (c+d x)}}{d}\)

\(\Big \downarrow \) 3966

\(\displaystyle \frac {b \left (a^2+b^2\right ) \int \frac {1}{\sqrt {a+b \cot (c+d x)} \left (\cot ^2(c+d x) b^2+b^2\right )}d(b \cot (c+d x))}{d}-\frac {2 b \sqrt {a+b \cot (c+d x)}}{d}\)

\(\Big \downarrow \) 484

\(\displaystyle \frac {2 b \left (a^2+b^2\right ) \int \frac {1}{b^4 \cot ^4(c+d x)-2 a b^2 \cot ^2(c+d x)+a^2+b^2}d\sqrt {a+b \cot (c+d x)}}{d}-\frac {2 b \sqrt {a+b \cot (c+d x)}}{d}\)

\(\Big \downarrow \) 1407

\(\displaystyle \frac {2 b \left (a^2+b^2\right ) \left (\frac {\int \frac {\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}}-\sqrt {a+b \cot (c+d x)}}{b^2 \cot ^2(c+d x)+\sqrt {a^2+b^2}-\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} \sqrt {a+b \cot (c+d x)}}d\sqrt {a+b \cot (c+d x)}}{2 \sqrt {2} \sqrt {a^2+b^2} \sqrt {\sqrt {a^2+b^2}+a}}+\frac {\int \frac {\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}}+\sqrt {a+b \cot (c+d x)}}{b^2 \cot ^2(c+d x)+\sqrt {a^2+b^2}+\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} \sqrt {a+b \cot (c+d x)}}d\sqrt {a+b \cot (c+d x)}}{2 \sqrt {2} \sqrt {a^2+b^2} \sqrt {\sqrt {a^2+b^2}+a}}\right )}{d}-\frac {2 b \sqrt {a+b \cot (c+d x)}}{d}\)

\(\Big \downarrow \) 1142

\(\displaystyle \frac {2 b \left (a^2+b^2\right ) \left (\frac {\frac {\sqrt {\sqrt {a^2+b^2}+a} \int \frac {1}{b^2 \cot ^2(c+d x)+\sqrt {a^2+b^2}-\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} \sqrt {a+b \cot (c+d x)}}d\sqrt {a+b \cot (c+d x)}}{\sqrt {2}}-\frac {1}{2} \int -\frac {\sqrt {2} \left (\sqrt {a+\sqrt {a^2+b^2}}-\sqrt {2} \sqrt {a+b \cot (c+d x)}\right )}{b^2 \cot ^2(c+d x)+\sqrt {a^2+b^2}-\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} \sqrt {a+b \cot (c+d x)}}d\sqrt {a+b \cot (c+d x)}}{2 \sqrt {2} \sqrt {a^2+b^2} \sqrt {\sqrt {a^2+b^2}+a}}+\frac {\frac {\sqrt {\sqrt {a^2+b^2}+a} \int \frac {1}{b^2 \cot ^2(c+d x)+\sqrt {a^2+b^2}+\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} \sqrt {a+b \cot (c+d x)}}d\sqrt {a+b \cot (c+d x)}}{\sqrt {2}}+\frac {1}{2} \int \frac {\sqrt {2} \left (\sqrt {a+\sqrt {a^2+b^2}}+\sqrt {2} \sqrt {a+b \cot (c+d x)}\right )}{b^2 \cot ^2(c+d x)+\sqrt {a^2+b^2}+\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} \sqrt {a+b \cot (c+d x)}}d\sqrt {a+b \cot (c+d x)}}{2 \sqrt {2} \sqrt {a^2+b^2} \sqrt {\sqrt {a^2+b^2}+a}}\right )}{d}-\frac {2 b \sqrt {a+b \cot (c+d x)}}{d}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {2 b \left (a^2+b^2\right ) \left (\frac {\frac {\sqrt {\sqrt {a^2+b^2}+a} \int \frac {1}{b^2 \cot ^2(c+d x)+\sqrt {a^2+b^2}-\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} \sqrt {a+b \cot (c+d x)}}d\sqrt {a+b \cot (c+d x)}}{\sqrt {2}}+\frac {1}{2} \int \frac {\sqrt {2} \left (\sqrt {a+\sqrt {a^2+b^2}}-\sqrt {2} \sqrt {a+b \cot (c+d x)}\right )}{b^2 \cot ^2(c+d x)+\sqrt {a^2+b^2}-\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} \sqrt {a+b \cot (c+d x)}}d\sqrt {a+b \cot (c+d x)}}{2 \sqrt {2} \sqrt {a^2+b^2} \sqrt {\sqrt {a^2+b^2}+a}}+\frac {\frac {\sqrt {\sqrt {a^2+b^2}+a} \int \frac {1}{b^2 \cot ^2(c+d x)+\sqrt {a^2+b^2}+\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} \sqrt {a+b \cot (c+d x)}}d\sqrt {a+b \cot (c+d x)}}{\sqrt {2}}+\frac {1}{2} \int \frac {\sqrt {2} \left (\sqrt {a+\sqrt {a^2+b^2}}+\sqrt {2} \sqrt {a+b \cot (c+d x)}\right )}{b^2 \cot ^2(c+d x)+\sqrt {a^2+b^2}+\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} \sqrt {a+b \cot (c+d x)}}d\sqrt {a+b \cot (c+d x)}}{2 \sqrt {2} \sqrt {a^2+b^2} \sqrt {\sqrt {a^2+b^2}+a}}\right )}{d}-\frac {2 b \sqrt {a+b \cot (c+d x)}}{d}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {2 b \left (a^2+b^2\right ) \left (\frac {\frac {\sqrt {\sqrt {a^2+b^2}+a} \int \frac {1}{b^2 \cot ^2(c+d x)+\sqrt {a^2+b^2}-\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} \sqrt {a+b \cot (c+d x)}}d\sqrt {a+b \cot (c+d x)}}{\sqrt {2}}+\frac {\int \frac {\sqrt {a+\sqrt {a^2+b^2}}-\sqrt {2} \sqrt {a+b \cot (c+d x)}}{b^2 \cot ^2(c+d x)+\sqrt {a^2+b^2}-\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} \sqrt {a+b \cot (c+d x)}}d\sqrt {a+b \cot (c+d x)}}{\sqrt {2}}}{2 \sqrt {2} \sqrt {a^2+b^2} \sqrt {\sqrt {a^2+b^2}+a}}+\frac {\frac {\sqrt {\sqrt {a^2+b^2}+a} \int \frac {1}{b^2 \cot ^2(c+d x)+\sqrt {a^2+b^2}+\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} \sqrt {a+b \cot (c+d x)}}d\sqrt {a+b \cot (c+d x)}}{\sqrt {2}}+\frac {\int \frac {\sqrt {a+\sqrt {a^2+b^2}}+\sqrt {2} \sqrt {a+b \cot (c+d x)}}{b^2 \cot ^2(c+d x)+\sqrt {a^2+b^2}+\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} \sqrt {a+b \cot (c+d x)}}d\sqrt {a+b \cot (c+d x)}}{\sqrt {2}}}{2 \sqrt {2} \sqrt {a^2+b^2} \sqrt {\sqrt {a^2+b^2}+a}}\right )}{d}-\frac {2 b \sqrt {a+b \cot (c+d x)}}{d}\)

\(\Big \downarrow \) 1083

\(\displaystyle \frac {2 b \left (a^2+b^2\right ) \left (\frac {\frac {\int \frac {\sqrt {a+\sqrt {a^2+b^2}}-\sqrt {2} \sqrt {a+b \cot (c+d x)}}{b^2 \cot ^2(c+d x)+\sqrt {a^2+b^2}-\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} \sqrt {a+b \cot (c+d x)}}d\sqrt {a+b \cot (c+d x)}}{\sqrt {2}}-\sqrt {2} \sqrt {\sqrt {a^2+b^2}+a} \int \frac {1}{2 \left (a-\sqrt {a^2+b^2}\right )-b^2 \cot ^2(c+d x)}d\left (2 \sqrt {a+b \cot (c+d x)}-\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}}\right )}{2 \sqrt {2} \sqrt {a^2+b^2} \sqrt {\sqrt {a^2+b^2}+a}}+\frac {\frac {\int \frac {\sqrt {a+\sqrt {a^2+b^2}}+\sqrt {2} \sqrt {a+b \cot (c+d x)}}{b^2 \cot ^2(c+d x)+\sqrt {a^2+b^2}+\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} \sqrt {a+b \cot (c+d x)}}d\sqrt {a+b \cot (c+d x)}}{\sqrt {2}}-\sqrt {2} \sqrt {\sqrt {a^2+b^2}+a} \int \frac {1}{2 \left (a-\sqrt {a^2+b^2}\right )-b^2 \cot ^2(c+d x)}d\left (\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}}+2 \sqrt {a+b \cot (c+d x)}\right )}{2 \sqrt {2} \sqrt {a^2+b^2} \sqrt {\sqrt {a^2+b^2}+a}}\right )}{d}-\frac {2 b \sqrt {a+b \cot (c+d x)}}{d}\)

\(\Big \downarrow \) 219

\(\displaystyle \frac {2 b \left (a^2+b^2\right ) \left (\frac {\frac {\int \frac {\sqrt {a+\sqrt {a^2+b^2}}-\sqrt {2} \sqrt {a+b \cot (c+d x)}}{b^2 \cot ^2(c+d x)+\sqrt {a^2+b^2}-\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} \sqrt {a+b \cot (c+d x)}}d\sqrt {a+b \cot (c+d x)}}{\sqrt {2}}-\frac {\sqrt {\sqrt {a^2+b^2}+a} \text {arctanh}\left (\frac {2 \sqrt {a+b \cot (c+d x)}-\sqrt {2} \sqrt {\sqrt {a^2+b^2}+a}}{\sqrt {2} \sqrt {a-\sqrt {a^2+b^2}}}\right )}{\sqrt {a-\sqrt {a^2+b^2}}}}{2 \sqrt {2} \sqrt {a^2+b^2} \sqrt {\sqrt {a^2+b^2}+a}}+\frac {\frac {\int \frac {\sqrt {a+\sqrt {a^2+b^2}}+\sqrt {2} \sqrt {a+b \cot (c+d x)}}{b^2 \cot ^2(c+d x)+\sqrt {a^2+b^2}+\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} \sqrt {a+b \cot (c+d x)}}d\sqrt {a+b \cot (c+d x)}}{\sqrt {2}}-\frac {\sqrt {\sqrt {a^2+b^2}+a} \text {arctanh}\left (\frac {\sqrt {2} \sqrt {\sqrt {a^2+b^2}+a}+2 \sqrt {a+b \cot (c+d x)}}{\sqrt {2} \sqrt {a-\sqrt {a^2+b^2}}}\right )}{\sqrt {a-\sqrt {a^2+b^2}}}}{2 \sqrt {2} \sqrt {a^2+b^2} \sqrt {\sqrt {a^2+b^2}+a}}\right )}{d}-\frac {2 b \sqrt {a+b \cot (c+d x)}}{d}\)

\(\Big \downarrow \) 1103

\(\displaystyle \frac {2 b \left (a^2+b^2\right ) \left (\frac {-\frac {\sqrt {\sqrt {a^2+b^2}+a} \text {arctanh}\left (\frac {2 \sqrt {a+b \cot (c+d x)}-\sqrt {2} \sqrt {\sqrt {a^2+b^2}+a}}{\sqrt {2} \sqrt {a-\sqrt {a^2+b^2}}}\right )}{\sqrt {a-\sqrt {a^2+b^2}}}-\frac {1}{2} \log \left (-\sqrt {2} \sqrt {\sqrt {a^2+b^2}+a} \sqrt {a+b \cot (c+d x)}+\sqrt {a^2+b^2}+b^2 \cot ^2(c+d x)\right )}{2 \sqrt {2} \sqrt {a^2+b^2} \sqrt {\sqrt {a^2+b^2}+a}}+\frac {\frac {1}{2} \log \left (\sqrt {2} \sqrt {\sqrt {a^2+b^2}+a} \sqrt {a+b \cot (c+d x)}+\sqrt {a^2+b^2}+b^2 \cot ^2(c+d x)\right )-\frac {\sqrt {\sqrt {a^2+b^2}+a} \text {arctanh}\left (\frac {\sqrt {2} \sqrt {\sqrt {a^2+b^2}+a}+2 \sqrt {a+b \cot (c+d x)}}{\sqrt {2} \sqrt {a-\sqrt {a^2+b^2}}}\right )}{\sqrt {a-\sqrt {a^2+b^2}}}}{2 \sqrt {2} \sqrt {a^2+b^2} \sqrt {\sqrt {a^2+b^2}+a}}\right )}{d}-\frac {2 b \sqrt {a+b \cot (c+d x)}}{d}\)

input
Int[(-a + b*Cot[c + d*x])*Sqrt[a + b*Cot[c + d*x]],x]
 
output
(-2*b*Sqrt[a + b*Cot[c + d*x]])/d + (2*b*(a^2 + b^2)*((-((Sqrt[a + Sqrt[a^ 
2 + b^2]]*ArcTanh[(-(Sqrt[2]*Sqrt[a + Sqrt[a^2 + b^2]]) + 2*Sqrt[a + b*Cot 
[c + d*x]])/(Sqrt[2]*Sqrt[a - Sqrt[a^2 + b^2]])])/Sqrt[a - Sqrt[a^2 + b^2] 
]) - Log[Sqrt[a^2 + b^2] + b^2*Cot[c + d*x]^2 - Sqrt[2]*Sqrt[a + Sqrt[a^2 
+ b^2]]*Sqrt[a + b*Cot[c + d*x]]]/2)/(2*Sqrt[2]*Sqrt[a^2 + b^2]*Sqrt[a + S 
qrt[a^2 + b^2]]) + (-((Sqrt[a + Sqrt[a^2 + b^2]]*ArcTanh[(Sqrt[2]*Sqrt[a + 
 Sqrt[a^2 + b^2]] + 2*Sqrt[a + b*Cot[c + d*x]])/(Sqrt[2]*Sqrt[a - Sqrt[a^2 
 + b^2]])])/Sqrt[a - Sqrt[a^2 + b^2]]) + Log[Sqrt[a^2 + b^2] + b^2*Cot[c + 
 d*x]^2 + Sqrt[2]*Sqrt[a + Sqrt[a^2 + b^2]]*Sqrt[a + b*Cot[c + d*x]]]/2)/( 
2*Sqrt[2]*Sqrt[a^2 + b^2]*Sqrt[a + Sqrt[a^2 + b^2]])))/d
 

3.1.100.3.1 Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 219
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* 
ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt 
Q[a, 0] || LtQ[b, 0])
 

rule 484
Int[1/(Sqrt[(c_) + (d_.)*(x_)]*((a_) + (b_.)*(x_)^2)), x_Symbol] :> Simp[2* 
d   Subst[Int[1/(b*c^2 + a*d^2 - 2*b*c*x^2 + b*x^4), x], x, Sqrt[c + d*x]], 
 x] /; FreeQ[{a, b, c, d}, x]
 

rule 1083
Int[((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Simp[-2   Subst[I 
nt[1/Simp[b^2 - 4*a*c - x^2, x], x], x, b + 2*c*x], x] /; FreeQ[{a, b, c}, 
x]
 

rule 1103
Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> S 
imp[d*(Log[RemoveContent[a + b*x + c*x^2, x]]/b), x] /; FreeQ[{a, b, c, d, 
e}, x] && EqQ[2*c*d - b*e, 0]
 

rule 1142
Int[((d_.) + (e_.)*(x_))/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> S 
imp[(2*c*d - b*e)/(2*c)   Int[1/(a + b*x + c*x^2), x], x] + Simp[e/(2*c) 
Int[(b + 2*c*x)/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e}, x]
 

rule 1407
Int[((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(-1), x_Symbol] :> With[{q = Rt[a/ 
c, 2]}, With[{r = Rt[2*q - b/c, 2]}, Simp[1/(2*c*q*r)   Int[(r - x)/(q - r* 
x + x^2), x], x] + Simp[1/(2*c*q*r)   Int[(r + x)/(q + r*x + x^2), x], x]]] 
 /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0] && NegQ[b^2 - 4*a*c]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3966
Int[((a_) + (b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[b/d   Su 
bst[Int[(a + x)^n/(b^2 + x^2), x], x, b*Tan[c + d*x]], x] /; FreeQ[{a, b, c 
, d, n}, x] && NeQ[a^2 + b^2, 0]
 

rule 4011
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + 
 (f_.)*(x_)]), x_Symbol] :> Simp[d*((a + b*Tan[e + f*x])^m/(f*m)), x] + Int 
[(a + b*Tan[e + f*x])^(m - 1)*Simp[a*c - b*d + (b*c + a*d)*Tan[e + f*x], x] 
, x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 
 0] && GtQ[m, 0]
 
3.1.100.4 Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(815\) vs. \(2(341)=682\).

Time = 0.06 (sec) , antiderivative size = 816, normalized size of antiderivative = 1.93

method result size
parts \(\frac {b \left (-2 \sqrt {a +b \cot \left (d x +c \right )}+\frac {\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \ln \left (b \cot \left (d x +c \right )+a +\sqrt {a +b \cot \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}+\sqrt {a^{2}+b^{2}}\right )}{4}-\frac {\left (a -\sqrt {a^{2}+b^{2}}\right ) \arctan \left (\frac {2 \sqrt {a +b \cot \left (d x +c \right )}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right )}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}-\frac {\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \ln \left (\sqrt {a +b \cot \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-b \cot \left (d x +c \right )-\sqrt {a^{2}+b^{2}}-a \right )}{4}-\frac {\left (\sqrt {a^{2}+b^{2}}-a \right ) \arctan \left (\frac {-2 \sqrt {a +b \cot \left (d x +c \right )}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right )}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right )}{d}+\frac {\ln \left (b \cot \left (d x +c \right )+a +\sqrt {a +b \cot \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}+\sqrt {a^{2}+b^{2}}\right ) \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{2}}{4 d b}-\frac {\ln \left (b \cot \left (d x +c \right )+a +\sqrt {a +b \cot \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}+\sqrt {a^{2}+b^{2}}\right ) \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a}{4 d b}+\frac {b \arctan \left (\frac {2 \sqrt {a +b \cot \left (d x +c \right )}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right ) a}{d \sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}-\frac {\ln \left (\sqrt {a +b \cot \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-b \cot \left (d x +c \right )-\sqrt {a^{2}+b^{2}}-a \right ) \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{2}}{4 d b}+\frac {\ln \left (\sqrt {a +b \cot \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-b \cot \left (d x +c \right )-\sqrt {a^{2}+b^{2}}-a \right ) \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a}{4 d b}-\frac {b \arctan \left (\frac {-2 \sqrt {a +b \cot \left (d x +c \right )}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right ) a}{d \sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\) \(816\)
derivativedivides \(\text {Expression too large to display}\) \(2285\)
default \(\text {Expression too large to display}\) \(2285\)

input
int((-a+b*cot(d*x+c))*(a+b*cot(d*x+c))^(1/2),x,method=_RETURNVERBOSE)
 
output
b/d*(-2*(a+b*cot(d*x+c))^(1/2)+1/4*(2*(a^2+b^2)^(1/2)+2*a)^(1/2)*ln(b*cot( 
d*x+c)+a+(a+b*cot(d*x+c))^(1/2)*(2*(a^2+b^2)^(1/2)+2*a)^(1/2)+(a^2+b^2)^(1 
/2))-(a-(a^2+b^2)^(1/2))/(2*(a^2+b^2)^(1/2)-2*a)^(1/2)*arctan((2*(a+b*cot( 
d*x+c))^(1/2)+(2*(a^2+b^2)^(1/2)+2*a)^(1/2))/(2*(a^2+b^2)^(1/2)-2*a)^(1/2) 
)-1/4*(2*(a^2+b^2)^(1/2)+2*a)^(1/2)*ln((a+b*cot(d*x+c))^(1/2)*(2*(a^2+b^2) 
^(1/2)+2*a)^(1/2)-b*cot(d*x+c)-(a^2+b^2)^(1/2)-a)-((a^2+b^2)^(1/2)-a)/(2*( 
a^2+b^2)^(1/2)-2*a)^(1/2)*arctan((-2*(a+b*cot(d*x+c))^(1/2)+(2*(a^2+b^2)^( 
1/2)+2*a)^(1/2))/(2*(a^2+b^2)^(1/2)-2*a)^(1/2)))+1/4/d/b*ln(b*cot(d*x+c)+a 
+(a+b*cot(d*x+c))^(1/2)*(2*(a^2+b^2)^(1/2)+2*a)^(1/2)+(a^2+b^2)^(1/2))*(2* 
(a^2+b^2)^(1/2)+2*a)^(1/2)*a^2-1/4/d/b*ln(b*cot(d*x+c)+a+(a+b*cot(d*x+c))^ 
(1/2)*(2*(a^2+b^2)^(1/2)+2*a)^(1/2)+(a^2+b^2)^(1/2))*(2*(a^2+b^2)^(1/2)+2* 
a)^(1/2)*(a^2+b^2)^(1/2)*a+1/d*b/(2*(a^2+b^2)^(1/2)-2*a)^(1/2)*arctan((2*( 
a+b*cot(d*x+c))^(1/2)+(2*(a^2+b^2)^(1/2)+2*a)^(1/2))/(2*(a^2+b^2)^(1/2)-2* 
a)^(1/2))*a-1/4/d/b*ln((a+b*cot(d*x+c))^(1/2)*(2*(a^2+b^2)^(1/2)+2*a)^(1/2 
)-b*cot(d*x+c)-(a^2+b^2)^(1/2)-a)*(2*(a^2+b^2)^(1/2)+2*a)^(1/2)*a^2+1/4/d/ 
b*ln((a+b*cot(d*x+c))^(1/2)*(2*(a^2+b^2)^(1/2)+2*a)^(1/2)-b*cot(d*x+c)-(a^ 
2+b^2)^(1/2)-a)*(2*(a^2+b^2)^(1/2)+2*a)^(1/2)*(a^2+b^2)^(1/2)*a-1/d*b/(2*( 
a^2+b^2)^(1/2)-2*a)^(1/2)*arctan((-2*(a+b*cot(d*x+c))^(1/2)+(2*(a^2+b^2)^( 
1/2)+2*a)^(1/2))/(2*(a^2+b^2)^(1/2)-2*a)^(1/2))*a
 
3.1.100.5 Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 849 vs. \(2 (343) = 686\).

Time = 0.31 (sec) , antiderivative size = 849, normalized size of antiderivative = 2.01 \[ \int (-a+b \cot (c+d x)) \sqrt {a+b \cot (c+d x)} \, dx=\frac {d \sqrt {-\frac {a^{3} + a b^{2} + d^{2} \sqrt {-\frac {a^{4} b^{2} + 2 \, a^{2} b^{4} + b^{6}}{d^{4}}}}{d^{2}}} \log \left ({\left (a^{4} b + 2 \, a^{2} b^{3} + b^{5}\right )} \sqrt {\frac {b \cos \left (2 \, d x + 2 \, c\right ) + a \sin \left (2 \, d x + 2 \, c\right ) + b}{\sin \left (2 \, d x + 2 \, c\right )}} + {\left (a d^{3} \sqrt {-\frac {a^{4} b^{2} + 2 \, a^{2} b^{4} + b^{6}}{d^{4}}} + {\left (a^{2} b^{2} + b^{4}\right )} d\right )} \sqrt {-\frac {a^{3} + a b^{2} + d^{2} \sqrt {-\frac {a^{4} b^{2} + 2 \, a^{2} b^{4} + b^{6}}{d^{4}}}}{d^{2}}}\right ) - d \sqrt {-\frac {a^{3} + a b^{2} + d^{2} \sqrt {-\frac {a^{4} b^{2} + 2 \, a^{2} b^{4} + b^{6}}{d^{4}}}}{d^{2}}} \log \left ({\left (a^{4} b + 2 \, a^{2} b^{3} + b^{5}\right )} \sqrt {\frac {b \cos \left (2 \, d x + 2 \, c\right ) + a \sin \left (2 \, d x + 2 \, c\right ) + b}{\sin \left (2 \, d x + 2 \, c\right )}} - {\left (a d^{3} \sqrt {-\frac {a^{4} b^{2} + 2 \, a^{2} b^{4} + b^{6}}{d^{4}}} + {\left (a^{2} b^{2} + b^{4}\right )} d\right )} \sqrt {-\frac {a^{3} + a b^{2} + d^{2} \sqrt {-\frac {a^{4} b^{2} + 2 \, a^{2} b^{4} + b^{6}}{d^{4}}}}{d^{2}}}\right ) - d \sqrt {-\frac {a^{3} + a b^{2} - d^{2} \sqrt {-\frac {a^{4} b^{2} + 2 \, a^{2} b^{4} + b^{6}}{d^{4}}}}{d^{2}}} \log \left ({\left (a^{4} b + 2 \, a^{2} b^{3} + b^{5}\right )} \sqrt {\frac {b \cos \left (2 \, d x + 2 \, c\right ) + a \sin \left (2 \, d x + 2 \, c\right ) + b}{\sin \left (2 \, d x + 2 \, c\right )}} + {\left (a d^{3} \sqrt {-\frac {a^{4} b^{2} + 2 \, a^{2} b^{4} + b^{6}}{d^{4}}} - {\left (a^{2} b^{2} + b^{4}\right )} d\right )} \sqrt {-\frac {a^{3} + a b^{2} - d^{2} \sqrt {-\frac {a^{4} b^{2} + 2 \, a^{2} b^{4} + b^{6}}{d^{4}}}}{d^{2}}}\right ) + d \sqrt {-\frac {a^{3} + a b^{2} - d^{2} \sqrt {-\frac {a^{4} b^{2} + 2 \, a^{2} b^{4} + b^{6}}{d^{4}}}}{d^{2}}} \log \left ({\left (a^{4} b + 2 \, a^{2} b^{3} + b^{5}\right )} \sqrt {\frac {b \cos \left (2 \, d x + 2 \, c\right ) + a \sin \left (2 \, d x + 2 \, c\right ) + b}{\sin \left (2 \, d x + 2 \, c\right )}} - {\left (a d^{3} \sqrt {-\frac {a^{4} b^{2} + 2 \, a^{2} b^{4} + b^{6}}{d^{4}}} - {\left (a^{2} b^{2} + b^{4}\right )} d\right )} \sqrt {-\frac {a^{3} + a b^{2} - d^{2} \sqrt {-\frac {a^{4} b^{2} + 2 \, a^{2} b^{4} + b^{6}}{d^{4}}}}{d^{2}}}\right ) - 4 \, b \sqrt {\frac {b \cos \left (2 \, d x + 2 \, c\right ) + a \sin \left (2 \, d x + 2 \, c\right ) + b}{\sin \left (2 \, d x + 2 \, c\right )}}}{2 \, d} \]

input
integrate((-a+b*cot(d*x+c))*(a+b*cot(d*x+c))^(1/2),x, algorithm="fricas")
 
output
1/2*(d*sqrt(-(a^3 + a*b^2 + d^2*sqrt(-(a^4*b^2 + 2*a^2*b^4 + b^6)/d^4))/d^ 
2)*log((a^4*b + 2*a^2*b^3 + b^5)*sqrt((b*cos(2*d*x + 2*c) + a*sin(2*d*x + 
2*c) + b)/sin(2*d*x + 2*c)) + (a*d^3*sqrt(-(a^4*b^2 + 2*a^2*b^4 + b^6)/d^4 
) + (a^2*b^2 + b^4)*d)*sqrt(-(a^3 + a*b^2 + d^2*sqrt(-(a^4*b^2 + 2*a^2*b^4 
 + b^6)/d^4))/d^2)) - d*sqrt(-(a^3 + a*b^2 + d^2*sqrt(-(a^4*b^2 + 2*a^2*b^ 
4 + b^6)/d^4))/d^2)*log((a^4*b + 2*a^2*b^3 + b^5)*sqrt((b*cos(2*d*x + 2*c) 
 + a*sin(2*d*x + 2*c) + b)/sin(2*d*x + 2*c)) - (a*d^3*sqrt(-(a^4*b^2 + 2*a 
^2*b^4 + b^6)/d^4) + (a^2*b^2 + b^4)*d)*sqrt(-(a^3 + a*b^2 + d^2*sqrt(-(a^ 
4*b^2 + 2*a^2*b^4 + b^6)/d^4))/d^2)) - d*sqrt(-(a^3 + a*b^2 - d^2*sqrt(-(a 
^4*b^2 + 2*a^2*b^4 + b^6)/d^4))/d^2)*log((a^4*b + 2*a^2*b^3 + b^5)*sqrt((b 
*cos(2*d*x + 2*c) + a*sin(2*d*x + 2*c) + b)/sin(2*d*x + 2*c)) + (a*d^3*sqr 
t(-(a^4*b^2 + 2*a^2*b^4 + b^6)/d^4) - (a^2*b^2 + b^4)*d)*sqrt(-(a^3 + a*b^ 
2 - d^2*sqrt(-(a^4*b^2 + 2*a^2*b^4 + b^6)/d^4))/d^2)) + d*sqrt(-(a^3 + a*b 
^2 - d^2*sqrt(-(a^4*b^2 + 2*a^2*b^4 + b^6)/d^4))/d^2)*log((a^4*b + 2*a^2*b 
^3 + b^5)*sqrt((b*cos(2*d*x + 2*c) + a*sin(2*d*x + 2*c) + b)/sin(2*d*x + 2 
*c)) - (a*d^3*sqrt(-(a^4*b^2 + 2*a^2*b^4 + b^6)/d^4) - (a^2*b^2 + b^4)*d)* 
sqrt(-(a^3 + a*b^2 - d^2*sqrt(-(a^4*b^2 + 2*a^2*b^4 + b^6)/d^4))/d^2)) - 4 
*b*sqrt((b*cos(2*d*x + 2*c) + a*sin(2*d*x + 2*c) + b)/sin(2*d*x + 2*c)))/d
 
3.1.100.6 Sympy [F]

\[ \int (-a+b \cot (c+d x)) \sqrt {a+b \cot (c+d x)} \, dx=- \int a \sqrt {a + b \cot {\left (c + d x \right )}}\, dx - \int \left (- b \sqrt {a + b \cot {\left (c + d x \right )}} \cot {\left (c + d x \right )}\right )\, dx \]

input
integrate((-a+b*cot(d*x+c))*(a+b*cot(d*x+c))**(1/2),x)
 
output
-Integral(a*sqrt(a + b*cot(c + d*x)), x) - Integral(-b*sqrt(a + b*cot(c + 
d*x))*cot(c + d*x), x)
 
3.1.100.7 Maxima [F]

\[ \int (-a+b \cot (c+d x)) \sqrt {a+b \cot (c+d x)} \, dx=\int { \sqrt {b \cot \left (d x + c\right ) + a} {\left (b \cot \left (d x + c\right ) - a\right )} \,d x } \]

input
integrate((-a+b*cot(d*x+c))*(a+b*cot(d*x+c))^(1/2),x, algorithm="maxima")
 
output
integrate(sqrt(b*cot(d*x + c) + a)*(b*cot(d*x + c) - a), x)
 
3.1.100.8 Giac [F]

\[ \int (-a+b \cot (c+d x)) \sqrt {a+b \cot (c+d x)} \, dx=\int { \sqrt {b \cot \left (d x + c\right ) + a} {\left (b \cot \left (d x + c\right ) - a\right )} \,d x } \]

input
integrate((-a+b*cot(d*x+c))*(a+b*cot(d*x+c))^(1/2),x, algorithm="giac")
 
output
integrate(sqrt(b*cot(d*x + c) + a)*(b*cot(d*x + c) - a), x)
 
3.1.100.9 Mupad [B] (verification not implemented)

Time = 14.20 (sec) , antiderivative size = 583, normalized size of antiderivative = 1.38 \[ \int (-a+b \cot (c+d x)) \sqrt {a+b \cot (c+d x)} \, dx=-\mathrm {atanh}\left (\frac {d^3\,\left (\frac {16\,\left (a^2\,b^4-a^4\,b^2\right )\,\sqrt {a+b\,\mathrm {cot}\left (c+d\,x\right )}}{d^2}+\frac {16\,a\,b^2\,\left (a^3+1{}\mathrm {i}\,b\,a^2\right )\,\sqrt {a+b\,\mathrm {cot}\left (c+d\,x\right )}}{d^2}\right )\,\sqrt {-\frac {a^3+1{}\mathrm {i}\,b\,a^2}{d^2}}}{16\,\left (a^5\,b^3+a^3\,b^5\right )}\right )\,\sqrt {-\frac {a^3+1{}\mathrm {i}\,b\,a^2}{d^2}}-\mathrm {atanh}\left (\frac {d^3\,\sqrt {\frac {-a^3+a^2\,b\,1{}\mathrm {i}}{d^2}}\,\left (\frac {16\,\left (a^2\,b^4-a^4\,b^2\right )\,\sqrt {a+b\,\mathrm {cot}\left (c+d\,x\right )}}{d^2}-\frac {16\,a\,b^2\,\left (-a^3+a^2\,b\,1{}\mathrm {i}\right )\,\sqrt {a+b\,\mathrm {cot}\left (c+d\,x\right )}}{d^2}\right )}{16\,\left (a^5\,b^3+a^3\,b^5\right )}\right )\,\sqrt {\frac {-a^3+a^2\,b\,1{}\mathrm {i}}{d^2}}-\frac {2\,b\,\sqrt {a+b\,\mathrm {cot}\left (c+d\,x\right )}}{d}+\mathrm {atan}\left (\frac {b^6\,\sqrt {\frac {a\,b^2}{4\,d^2}-\frac {b^3\,1{}\mathrm {i}}{4\,d^2}}\,\sqrt {a+b\,\mathrm {cot}\left (c+d\,x\right )}\,32{}\mathrm {i}}{\frac {b^8\,16{}\mathrm {i}}{d}+\frac {a^2\,b^6\,16{}\mathrm {i}}{d}}+\frac {32\,a\,b^5\,\sqrt {\frac {a\,b^2}{4\,d^2}-\frac {b^3\,1{}\mathrm {i}}{4\,d^2}}\,\sqrt {a+b\,\mathrm {cot}\left (c+d\,x\right )}}{\frac {b^8\,16{}\mathrm {i}}{d}+\frac {a^2\,b^6\,16{}\mathrm {i}}{d}}\right )\,\sqrt {\frac {a\,b^2-b^3\,1{}\mathrm {i}}{4\,d^2}}\,2{}\mathrm {i}-\mathrm {atan}\left (\frac {b^6\,\sqrt {\frac {a\,b^2}{4\,d^2}+\frac {b^3\,1{}\mathrm {i}}{4\,d^2}}\,\sqrt {a+b\,\mathrm {cot}\left (c+d\,x\right )}\,32{}\mathrm {i}}{\frac {b^8\,16{}\mathrm {i}}{d}+\frac {a^2\,b^6\,16{}\mathrm {i}}{d}}-\frac {32\,a\,b^5\,\sqrt {\frac {a\,b^2}{4\,d^2}+\frac {b^3\,1{}\mathrm {i}}{4\,d^2}}\,\sqrt {a+b\,\mathrm {cot}\left (c+d\,x\right )}}{\frac {b^8\,16{}\mathrm {i}}{d}+\frac {a^2\,b^6\,16{}\mathrm {i}}{d}}\right )\,\sqrt {\frac {b^3\,1{}\mathrm {i}+a\,b^2}{4\,d^2}}\,2{}\mathrm {i} \]

input
int(-(a + b*cot(c + d*x))^(1/2)*(a - b*cot(c + d*x)),x)
 
output
atan((b^6*((a*b^2)/(4*d^2) - (b^3*1i)/(4*d^2))^(1/2)*(a + b*cot(c + d*x))^ 
(1/2)*32i)/((b^8*16i)/d + (a^2*b^6*16i)/d) + (32*a*b^5*((a*b^2)/(4*d^2) - 
(b^3*1i)/(4*d^2))^(1/2)*(a + b*cot(c + d*x))^(1/2))/((b^8*16i)/d + (a^2*b^ 
6*16i)/d))*((a*b^2 - b^3*1i)/(4*d^2))^(1/2)*2i - atan((b^6*((b^3*1i)/(4*d^ 
2) + (a*b^2)/(4*d^2))^(1/2)*(a + b*cot(c + d*x))^(1/2)*32i)/((b^8*16i)/d + 
 (a^2*b^6*16i)/d) - (32*a*b^5*((b^3*1i)/(4*d^2) + (a*b^2)/(4*d^2))^(1/2)*( 
a + b*cot(c + d*x))^(1/2))/((b^8*16i)/d + (a^2*b^6*16i)/d))*((a*b^2 + b^3* 
1i)/(4*d^2))^(1/2)*2i - atanh((d^3*((16*(a^2*b^4 - a^4*b^2)*(a + b*cot(c + 
 d*x))^(1/2))/d^2 + (16*a*b^2*(a^2*b*1i + a^3)*(a + b*cot(c + d*x))^(1/2)) 
/d^2)*(-(a^2*b*1i + a^3)/d^2)^(1/2))/(16*(a^3*b^5 + a^5*b^3)))*(-(a^2*b*1i 
 + a^3)/d^2)^(1/2) - atanh((d^3*((a^2*b*1i - a^3)/d^2)^(1/2)*((16*(a^2*b^4 
 - a^4*b^2)*(a + b*cot(c + d*x))^(1/2))/d^2 - (16*a*b^2*(a^2*b*1i - a^3)*( 
a + b*cot(c + d*x))^(1/2))/d^2))/(16*(a^3*b^5 + a^5*b^3)))*((a^2*b*1i - a^ 
3)/d^2)^(1/2) - (2*b*(a + b*cot(c + d*x))^(1/2))/d